function Tn=Tn(x,y) 
    n=length(x);
    h=x(2)-x(1);
    sum=0;
    for k=2:n-1
        sum=sum+y(k);
    end
    Tn=(y(1)+2*sum+y(n))*h/2;
end
